Skip to content

Conversation

@artembaranovsky1
Copy link

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

I am requesting changes because your submission doesn't fully meet the task requirements and violates a couple of checklist items. You've done a great job creating the Sum component, but there are a few key areas that need correction.

First, in src/App.jsx, the requirement to test default props was not met. Instead of omitting props to let the defaults apply, you passed them explicitly (e.g., <Sum a={10} b={0} />). To fix this, you should remove the prop you aren't testing, for example: <Sum a={10} />.

Additionally, there are two style guide violations:

  1. In src/components/Sum/Sum.jsx, you need to use string interpolation for the output as per [CHECKLIST ITEM #2]: {`Sum of ${a} and ${b} is ${a + b}`}.
  2. In src/App.jsx, all <Sum /> components should be written on a single line as they have fewer than three attributes [CHECKLIST ITEM #1].

Please address these points, and your solution will be ready for approval!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

import React from 'react';

export const Sum = ({a = 0, b = 0}) => (
<p>Sum of {a} and {b} is {a + b}</p>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #2: 'Use string interpolation inside tag content'. While your current approach is valid, the task specifically requests using a template literal for the text content.

src/App.jsx Outdated
Comment on lines 7 to 26
<Sum
a={2}
b={3}
/>
<Sum
a={-5}
b={5}
/>
<Sum
a={10}
b={0}
/>
<Sum
a={0}
b={5}
/>
<Sum
a={0}
b={0}
/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This violates checklist item #1: 'If you have < 3 attribues on a tag and the values are short write the tag in one line (to make it easier to write and read)'. All <Sum /> components in this file should be written on a single line.

src/App.jsx Outdated
Comment on lines 15 to 18
<Sum
a={10}
b={0}
/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The requirement is to pass only a = 10 here. The b prop should be omitted entirely to allow its default value from the Sum component to be used.

src/App.jsx Outdated
Comment on lines 19 to 22
<Sum
a={0}
b={5}
/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the requirements, this Sum component should only receive the b prop. The a prop should be omitted so its default value is used.

src/App.jsx Outdated
Comment on lines 23 to 26
<Sum
a={0}
b={0}
/>

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Sum component should be called without any props to test the default values for both a and b, as specified in the task description.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on this iteration! I am happy to approve your solution as you've successfully addressed all the feedback from the previous review. The Sum component is implemented perfectly, and all requirements are now met. As a final suggestion for keeping your code professional, remember to remove instructional comments from files like src/App.jsx before finalizing your work. This is a minor point but a great habit to build. Well done!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Comment on lines 12 to 13
{/* Replace paragraphs with Sum componets */}
{/* And remove commented lines :) */}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job on the implementation! As a final touch, it's good practice to remove instructional comments like these from your code once you've completed the task.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants